<%--                                                                       --%>
<%-- Copyright (c) 2001-2004 BroadVision, Inc.  All rights reserved.       --%>
<%--                                                                       --%>
<%-- This software is copyrighted. Under the copyright laws, this software --%>
<%-- may not be copied, in whole or in part, without prior written consent --%>
<%-- of BroadVision, Inc. or its assignees. This software is provided      --%>
<%-- under the terms of a license between BroadVision and the recipient,   --%>
<%-- and its use is subject to the terms of that license.                  --%>
<%--                                                                       --%>
<%-- This software may be protected by one or more U.S. and International  --%>
<%-- patents.  Certain applications of BroadVision One-To-One software are --%>
<%-- covered by U.S. patent 5,710,887.                                     --%>
<%--                                                                       --%>
<%-- TRADEMARKS: BroadVision and BroadVision One-To-One are registered     --%>
<%-- trademarks of BroadVision, Inc., in the United States and the         --%>
<%-- European Community, and are trademarks of BroadVision, Inc., in other --%>
<%-- countries.  The BroadVision logo, is a trademark of BroadVision,      --%>
<%-- Inc., in the United States and other countries. Additionally, IONA    --%>
<%-- and Orbix are trademarks of IONA Technologies, Ltd.  RSA, MD5, and    --%>
<%-- RC2 are trademarks of RSA Data Security, Inc.                         --%>
<%--                                                                       --%>

<%@ page language="java" %>
<%@ page import="org.apache.struts.action.*" %>
<%@ page import="org.apache.commons.beanutils.PropertyUtils" %>
<%@ page import="java.util.*" %>

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/bv-html.tld" prefix="bvhtml" %>


  <%
     com.broadvision.web.util.ViewDynaBean roleUserListView = (com.broadvision.web.util.ViewDynaBean) request.getAttribute("taskView");

     boolean usePhase = true;
     
     try {
       Boolean b = (Boolean)PropertyUtils.getProperty(roleUserListView, "usePhase");
       if (null != b)
         usePhase = b.booleanValue();
     }
     catch (Exception ee) {
     }
  %>

<script language="javascript">
function openwin(file) {
  var win = window.open(file , "NewWindow", 'toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=yes,width=450,height=338');
  win.focus();
}

function confirmDeleteTask(theForm, url) {
   if (confirm("<bean:message key="cs.tasks.confirm.delete"/>")) {
     theForm.action = url;
     theForm.submit();
     //return true;
   }
   else {
     return false;
   }
}
function clickMark(theForm, url) {
  theForm.action = url;
  theForm.submit();
}
</script>

<!-- Zone 5 starts here.  -->
<table class="zoneFive" width="100%" border="0" cellspacing="0" cellpadding="0"
       summary="content area">
  <tr>
    <td valign="top">

    <!--start microsite logo and name here-->
      <div class="pageTitle">
        <%@ include file="/cs/microsite/micrositeNaviInfo.jsp" %>
      </div>
    <!--end microsite logo and name here-->

    <div class="pageSubtitle">
      <span class="left">
         <bean:define id="taskViewName" name="taskView" property="name"/>
             <%String taskName = taskViewName.toString();%>
            <bean:message key="cs.view" arg0="<%=taskName %>"/>
      </span>
      <span class="right">
        <html:form action="/cs/taskEdit.do">
        <bvhtml:hiddenList name="micrositeNaviInfoView" property="urlParams" scope="request"/>
          <logic:notEqual name="taskView" property="isReadOnly" value="true">
          <logic:equal name="taskView" property="owner" value="true">
            <logic:equal name="taskView" property="completed" value="false">
            <input type="button" class="titleButton" name="markCompleteBtn"
                   value='<bean:message key="button.mark"/>'
                   titleKey="button.mark"
                   onclick="clickMark(this.form, '<html:rewrite page="/cs/taskMarkAsComplete.do"/>')">
            <!-- cannot add request parameter to rewrite tag above since it -->
            <!-- will be ignored by the IM for HTML form submission -->
            <input type=hidden name='markAction' value='markAsComplete' >
            <input type=hidden name='fromPage' value='view' >
            </logic:equal>
            <logic:equal name="taskView" property="completed" value="true">
            <input type="button" class="titleButton" name="markCompleteBtn"
                   value='<bean:message key="button.markInComplete"/>'
                   titleKey="button.markInComplete"
                   onclick="clickMark(this.form, '<html:rewrite page="/cs/taskMarkAsComplete.do"/>')">
            <!-- cannot add request parameter to rewrite tag above since it -->
            <!-- will be ignored by the IM for HTML form submission -->
            <input type=hidden name='markAction' value='markAsIncomplete' >
            <input type=hidden name='fromPage' value='view' >
            </logic:equal>
            <input type="submit" class="titleButton" name="editBtn"
                   value='<bean:message key="button.edit"/>'
                   titleKey="button.edit">

            <input type="button" class="titleButton" name="deleteBtn"
                   value='<bean:message key="button.delete"/>'
                   titleKey="button.delete"
                   onclick="confirmDeleteTask(this.form, '<html:rewrite page="/cs/taskDelete.do"/>')">
          </logic:equal>
          </logic:notEqual>
        </html:form>
      </span>
    </div>
    <!--end page title area here-->

    <div class="blockWrap">

    <!--start main content area here-->
    <table class="labelForm" width="100%" border="0" cellspacing="0"
            cellpadding="0" summary="Task Information">

      <tr>
        <td nowrap width="20%" class="label">
          <bean:message key="cs.description"/>:
        </td>
        <td width="80%" class="labelField">
        <bean:write name="taskView" property="description"/>&nbsp;
        </td>
      </tr>
<% if (usePhase) { %>      
      <tr>
        <td nowrap width="20%" class="label">
          <bean:message key="cs.phase"/>:
        </td>
        <td  width="80%" class="labelField">
          <bean:write name="taskView" property="phaseName"/>&nbsp;
        </td>
      </tr>
<% } %>
      <tr>
        <td nowrap width="20%" class="label">
          <bean:message key="cs.owner"/>:
        </td>
        <td width="80%" nowrap class="labelField">
        <bean:write name="taskView" property="ownerName"/>&nbsp;
        </td>
      </tr>
      <tr>
        <td nowrap width="20%" class="label">
          <bean:message key="cs.priority"/>:
        </td>
        <td width="80%" nowrap class="labelField">
            <logic:equal name="taskView" property="priority" value="0">
            <bean:message key="cs.high"/>
            </logic:equal>
            <logic:equal name="taskView" property="priority" value="1">
            <bean:message key="cs.medium"/>
            </logic:equal>
            <logic:equal name="taskView" property="priority" value="2">
            <bean:message key="cs.low"/>
            </logic:equal>
        </td>
      </tr>
      <tr>
        <td nowrap width="20%" class="label">
          <bean:message key="cs.tasks.startDate"/>:
        </td>
        <td width="80%" nowrap class="labelField">
          <bean:write name="taskView" property="startDate" formatKey="format.datetime.tasklist" filter="false" />&nbsp;
        </td>
      </tr>
      <tr>
        <td nowrap width="20%" class="label">
          <bean:message key="cs.tasks.dueDate"/>:
        </td>
        <td width="80%" nowrap class="labelField">
          <bean:write name="taskView" property="dueDate" formatKey="format.datetime.tasklist" filter="false" />&nbsp;
        </td>
      </tr>
      <tr>
        <td nowrap width="20%" class="label">
          <bean:message key="cs.tasks.completionDate"/>:
        </td>
        <td width="80%" nowrap class="labelField">
         <logic:equal name="taskView" property="completed" value="true">
          <bean:write name="taskView" property="completionDate" formatKey="format.datetime.tasklist" filter="false" />
         </logic:equal>&nbsp;
        </td>
      </tr>

      <!-- start of attachments secion -->
    </table>
    <!--end main content area here-->
<!-- start of attachments secion -->

     <!-- Attachment list begins. -->
    <bean:define id="beanUsed" name="taskView" toScope="request" />
    <%@ include file="/cs/microsite/attachment/attachmentView.jsp" %>
    <!-- Attachment list ends. -->

    </div>

    </td>
  </tr>
</table>
<!--end zone 5 content here -->
